package com.ybu;

import java.util.Iterator;
import java.util.LinkedHashSet;

/**
 * @ProjectName: shixun
 * @Titile: LinkedHashSetDemo
 * @Author: Jie
 * @Description: TODO
 */
public class LinkedHashSetDemo {
    public static void main(String[] args) {
        LinkedHashSet<String> set = new LinkedHashSet<>();
        set.add("张三");
        set.add("李四");
        set.add("王五");
        set.add("赵六");
        Iterator<String> iterator = set.iterator();
        while (iterator.hasNext()) {
            String next = iterator.next();
            System.out.println(next);
        }
    }
}
